package modelo.reglas.composite.inner;

import modelo.reglas.ISpecification;
import modelo.reglas.Specificable;

public class RangeSpecification<E extends Comparable<T>, T extends Specificable>
		extends ISpecification<T> {

	private E comparableDesde;
	private E comparableHasta;

	public RangeSpecification(E comparableDesde, E comparableHasta) {
		this.comparableDesde = comparableDesde;
		this.comparableHasta = comparableHasta;
	}

	@Override
	public Boolean isSatisfiedBy(T specificable) {
		return comparableDesde.compareTo( specificable) > 0
				&& comparableHasta.compareTo(specificable) < 0;
	}

}
